package com.rsstuan.utils;

import java.util.Arrays;
import java.util.Comparator;

import com.rsstuan.storage.data.TuanGouChannelData;

public class ChannelUtils {
	
	public static void sortByChannelId(TuanGouChannelData[] channels) {
		class ChannelIdComparator implements Comparator<TuanGouChannelData> {
			//@Override
			public int compare(TuanGouChannelData c1,
					TuanGouChannelData c2) {
				if (c1.getId() < c2.getId())
					return -1;
				else if (c1.getId() > c2.getId())
					return 1;
				return 0;
			}
		}
		Arrays.sort(channels, new ChannelIdComparator());
	}

}
